package com.cheeven.cwliu.citation.steps;

import java.util.HashMap;
import org.w3c.dom.Document;

public class Step4 extends StepBase {

	public static void openMarkedListPage(HashMap<String, String> control) {
		logInfo("4. Go to Marked List page");

		String nextAction = control.get("nextAction");
		logInfo(1, "Marked List Page at {0}", nextAction);

		String markedList = httpGet(nextAction);
		Document domdoc = toDOM(markedList);
		
		control.put("hitCount", cleanNumberFormat(xpath("//*[@id='hitCount.top']/text()", domdoc).trim()));
		logInfo(1, "hitCount={0}", control.get("hitCount"));

		control.put("nextAction", "http://apps.webofknowledge.com/" + xpath("//a[contains(@href,'product=WOS&colName=WOS')]/@href", domdoc));
		logInfo(1, "Web of Science page is {0}", control.get("nextAction"));

	}
}
